package conqueror.com.systemupdate.util;

import android.content.Context;
import android.telephony.TelephonyManager;

/**
 * Created by Administrator on 2016/8/16 0016.
 */
public class SystemUtil {
    /**
     * 获取设备IMEI
     *
     * @param context
     * @return
     */
    public static String getIMEI(Context context) {

        return ((TelephonyManager) context.getSystemService(

                Context.TELEPHONY_SERVICE)).getDeviceId();

    }

    /**
     * 获取安卓id
     *
     * @param context
     * @return
     */
    public static String getAndroidId(Context context) {

        return android.provider.Settings.Secure.getString(

                context.getContentResolver(),

                android.provider.Settings.Secure.ANDROID_ID);
    }

    /**
     * 手机型号
     *
     * @return
     */
    public static String getPhoneModel() {
        return android.os.Build.MODEL;
    }

    /**
     * 获取设备ID号
     *
     * @param context
     * @return
     */
    public static String getDeviceID(Context context) {
        TelephonyManager tm = (TelephonyManager) context.getSystemService(Context.TELEPHONY_SERVICE);
        return tm.getDeviceId();
    }
}
